function validate_format(field, alerttxt){
	with (field){
		var patt = /^(\n*>.+\n[ATUCGN\n]+)+$/i;
		value = value.replace(/(\r\n|\r|\n|(\u0085)|(\u2028)|(\u2029))/gi, "\n");
		if (patt.test(value)){
			return true;
		}
		else {
			alert(alerttxt);
			return false;
		}
	}
}

function validate_form(thisform, field, alerttxt){
	with (thisform){
		if (validate_format(field, alerttxt) == false){
			field.focus();
			return false;
		}
		else {
			return true;
		}
	}
}

/* var sample = ">Sample sequence\r\nGCCCGGAUAGCUCAGUCGGUAGAGCAUCAGACUUUUAAUCUGAGGGUCCAGGGUUCAAGUCCCUGUUCGGGCGCCA" */
var sample = "> seq1\nGACGGTGAGAATGTCTGGCTTTGCGTCATTGATGGACGGCATGATGGGTTTGAGCGAGTCCTGCGGTCCGGGTTACGGTATGTGGGGTAGGG\n> seq2\nCCCAAGTAGCAATGCGGAACATATCTAATTTCGGAATGAAGAGCAACTACC\n> seq3\nCAAAGATGTGAGGGTAGGACCAACAAGCCGACTGACCCCAGGAATGGGGACAATCTAGTTCCAGCTCAGCGGC\n> seq4\nTCAATGGACACATTAACTTCACCAAGATGACTACTCGATCAAAAA\n> seq5\nGTCAGTTATCCCGCGACATAATGGAGAATGCTAACGCCATTTTCCCTACCCGAATACACCTACCCATTGAGTAGCTGGG\n"

function paste(where, what){
	document.getElementById(where).value = what;
}

function clear(where){
	document.getElementById(where).value = "";
	document.getElementById(where).focus();
}
